package operation;

import Dao.UserDao;
import interfac.UserOperation;
import pojo.User;
import java.util.Scanner;

public class AddUserOperation implements UserOperation {
    @Override
    public void execute(Scanner scanner) {
        System.out.print("请输入新员工账号: ");
        String username = scanner.nextLine();

        System.out.print("请输入密码: ");
        String password = scanner.nextLine();
        User newUser = new User(0, username, password);
        UserDao userDao = new UserDao();
        userDao.addUser(newUser);
        System.out.println("新员工添加成功！");
    }
}